package com.bachongLightNovel.system.mapper;

import com.bachongLightNovel.model.dto.system.SystemUserAssignDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SystemUserRoleMapper {
    //根据用户id查询相应的角色id集合

    List<Long> selectRoleIdsByUserId(Long userId);

    //几多组数据插入到数据表当中
    void insertList(SystemUserAssignDto dto);

    //根据用户id删除相关数据
    @Delete("delete from user_role where user_id=#{userId};")
    void deleteByUserId(Long id);

    //根据角色id删除相关用户角色数据
    void deleteByRoleId(Long roleId);
}
